package org.abettor.angleworm.router.impl;

import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.abettor.angleworm.router.Route;

/**
 * @see org.abettor.angleworm.router.Route
 * @author <a href="http://www.abettor.org/" target="_blank">abettor</a>
 *
 */
public class RouteImpl implements Route
{
	private List<InetSocketAddress> peerAddrList = Collections.synchronizedList(new ArrayList<InetSocketAddress>());

	@Override
	public InetSocketAddress getDestination()
	{
		return peerAddrList.get(peerAddrList.size() - 1);
	}

	@Override
	public int getHops()
	{
		return peerAddrList.size();
	}

	public List<InetSocketAddress> getPeerAddrList()
	{
		return peerAddrList;
	}

	public void setPeerAddrList(List<InetSocketAddress> peerAddrList)
	{
		this.peerAddrList = peerAddrList;
	}
}
